'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 副本子项
 * @author sundbcn@gmail.com (sun debing)
 */

var moment = require('moment');
var mongoose = require('mongoose');

var copyItemSchema = new mongoose.Schema({
    // 副本id,与配置表中的副本id对应
    copy_id: {
        type: Number,
        require: true
    },

    // 星级
    star: {
        type: Number,
        default: 0
    },

    // 通关时间
    pass_time: {
        type: Date
    }
});

copyItemSchema.methods.getStar = function () {
    return this.star;
};

if (!copyItemSchema.options.toJSON) {
    copyItemSchema.options.toJSON = {};
}
/* jshint unused:false */
copyItemSchema.options.toJSON.transform = function (doc, ret) {
    delete ret.pass_time;
};

module.exports = copyItemSchema;
